#include <QImage>
#include <QPixmap>
#include "bibleebookitem.h"

BibleEBookItem::BibleEBookItem(QWidget *parent) : QWidget(parent)
{
    setStyleSheet("border:1px solid green;background-color:yellow;");
    createWidgets();
}

void BibleEBookItem::createWidgets()
{
    bookCover = new QLabel(this);
    bookCover->setFixedSize(175, 230);
    bookCover->setPixmap(QPixmap::fromImage(QImage(":/img/assets/images/example.jpg")));

    linkLabel = new QLabel(this);
    linkLabel->setFixedSize(175, 20);
    linkLabel->setAlignment(Qt::AlignHCenter);
    linkLabel->setTextFormat(Qt::RichText);
    linkLabel->setText(tr("<a href='br://ebook/read/identify'>Read</a> <a href='br://ebook/download/identify'>Download</a> <a href='br://ebook/detail/identify'>Detail</a>"));

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(bookCover, 23);
    layout->addWidget(linkLabel, 2);

    setLayout(layout);
}
